package testMaker;

import java.io.FileWriter;
import java.io.IOException;

import tools.Vector;

public class InstanceMaker {
	
	public static void main(String[] args) throws IOException {
		double[] limits = {30, 50};
		double[] deviation = {2,7};
		double[] values = {10, 50, 100};
		FileWriter out;
		Vector<Double> demandcost;
		Vector<Double> storagecost;
		Vector<Double> shortagevost;
		Vector<Double> demandlimits;
		Vector<Double> demands;
		Vector<Double> demanddev;
		
		for(int dim = 10; dim < 16; dim++ ){
			for(int i = 0; i < 2; i++){
				for(int k = 0; k <2; k++){
					for(int l = 0; l < 2; l++){
						for(int p = 0; p < 2; p++){
							out = new FileWriter("INTANCEd="+ Integer.toString(dim)+ "l="+ Integer.toString(i)+"dm="+ Integer.toString(k)+"st="+ Integer.toString(l)+"sh="+ Integer.toString(p)+".txt");
								
							demandlimits = InstanceTools.buildVector(dim, 0.0, limits[i]);
							out.write(demandlimits.toString());
							
							demandcost = InstanceTools.buildVector(dim, 0.0, deviation[k]);
							out.write(demandcost.toString());
							
							storagecost = InstanceTools.buildVector(dim, 0.0, deviation[l]);
							out.write(storagecost.toString());
							
							shortagevost = InstanceTools.buildVector(dim, 0.0, deviation[p]);
							out.write(shortagevost.toString());
							out.close();
						}
					}
				}
			}
			for(int i = 0; i < 2; i++){
					demands = InstanceTools.buildVector(dim, 0.0, 10);
					demanddev = InstanceTools.buildVector(dim, 0.0, deviation[i]);
					out = new FileWriter("REGset_"+ Integer.toString(dim)+ "_"+ Integer.toString(i)+".txt");
					out.write(demands.toString());
					out.write(demanddev.toString());
					out.close();
			}
			
			
			for(int i = 0; i < 3; i++){
					demands = InstanceTools.buildVector(dim, 0.0, 10);
					demanddev = InstanceTools.buildVectorGeo(dim, i, 10.0);
					out = new FileWriter("GEOset_"+ Integer.toString(dim)+ "_"+ Integer.toString(i)+".txt");
					out.write(demands.toString());
					out.write(demanddev.toString());
					out.close();
			}
			
			demands = InstanceTools.buildVector(dim, 0.0, 10);
			demanddev = InstanceTools.buildVectorRandom(dim, 10.0);
			out = new FileWriter("RANDset_"+ Integer.toString(dim)+".txt");
			out.write(demands.toString());
			out.write(demanddev.toString());
			out.close();
		}
	}	
}
